{extend name="public/base"}
{block name="title"}{$config['title']} - {$config['description']}{/block}
{block name="toptip"}主页{/block}
{block name="head"}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dropzone@5.7.1/dist/dropzone.min.css">
{/block}
{block name="toptip"}
<a href="{:url('/')}" title="返回首页"><i class="la la-arrow-left"></i></a>
<div>主题帖</div>
{/block}
{block name="body"}
<div id="feed_list">
    <div class="post card">
        <div class="card-body no-gutters">
            <div class="col mb-1">
                <div class="row no-gutters">
                    <img class="mr-2 rounded-circle" src="{$info.user.avatar_url}" width="42" height="42" />
                    <div class="flex-grow-1">
                        <div class="font-weight-bold">{$info.user.nickname}</div>
                        <div class="stamp">{:time_tran($info.create_time)}</div>
                    </div>
                </div>
            </div>
            <div class="col">
                {if !empty($info.text_format.text)}
                <div class="card-text">{$info.text_format.text|raw}</div>
                {/if}
                {if !empty($info.text_format.image)}
                <div class="post-image-row">
                    {volist name="info.text_format.image" id="url"}
                    <div class="post-image-col">
                        <img src="{$url}" />
                    </div>
                    {/volist}
                </div>
                <div class="artZoomBox">
                    <div class="tool clearfix">
                        <a href="javascript:void(0);" class="hideImg"><i class="la la-upload"></i>收起</a>
                        <a href="javascript:void(0);" class="viewImg" target="_blank"><i class="la la-external-link-square-alt"></i>查看原图</a>
                        <a href="javascript:void(0);" class="imgLeft"><i class="la la-undo-alt"></i>向左旋转</a>
                        <a href="javascript:void(0);" class="imgRight"><i class="la la-redo-alt"></i>向右旋转</a>
                    </div>
                    <div class="maxImgRow"></div>
                </div>
                {/if}
            </div>
        </div>
        <div class="handle row">
            <a class="col reply" href="{:url('Post/info',['id'=>$info.id])}" target="_blank"><i class="la la-comment"></i>{$info.comment_num}</a>
            <div class="col relay"><i class="la la-share"></i>{$info.relay_num}</div>
            <div class="col like"><i class="la la-heart-o"></i>{$info.upvote_num}</div>
            <div class="col more dropdown">
                <a class="dropdown-toggle" href="#" id="post-handle-more" data-toggle="dropdown"><i class="la la-ellipsis-h"></i></a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="post-handle-more">
                    {if $info.uid==$user.uid}
                    <button class="dropdown-item">删除</button>
                    {else}
                    <button class="dropdown-item">关注</button>
                    {/if}
                    <button class="dropdown-item">收藏</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="comments">
    <div class="comment-respond">
        <div class="comment-title">发表评论</div>
        <form method="post" action="{:url('/comment/add',['id'=>$info.id])}" class="comment-form d-flex flex-column">
            <textarea rows="1" name="text" class="comment-textarea" required></textarea>
            <div class="d-flex pt-2">
                <div class="flex-grow-1">
                    表情
                    图片
                    同时转发到我的微博
                </div>
                <button type="submit" class="btn btn-primary">评论</button>
                <button type="button" class="ml-2 btn btn-primary" id="cancel-comment-reply-link" onclick="wbbs.cancelReply()">取消</button>
            </div>
        </form>
    </div>
    <div class="comment-list">
        {include file="comment/data" /}
    </div>
</div>
{/block}
{block name="foot"}
<script>
    wbbs.picctrl();
    wbbs.bindLoadList();
    $('.comment-textarea').autoHeight();
</script>
{/block}